package cn.jiakeyun.umeng_vertify_example

import android.annotation.SuppressLint
import android.app.Activity
import android.app.Application
import android.os.Build
import android.os.Bundle
import android.util.Log
import androidx.annotation.RequiresApi
import cn.jiakeyun.umeng_vertify.UVerifyManagerConfig
import io.flutter.app.FlutterApplication

//主工程
class App : FlutterApplication(), Application.ActivityLifecycleCallbacks {


    override fun onCreate() {
        super.onCreate()
        registerActivityLifecycleCallbacks(this)
        UVerifyManagerConfig
            .initUMengVerify(applicationContext, "5f88fa2b80455950e4aba2fe", "umeng")
    }

    override fun onActivityCreated(activity: Activity, savedInstanceState: Bundle?) {
    }

    override fun onActivityStarted(activity: Activity) {
        ActivityManager.activity = activity
    }

    override fun onActivityResumed(activity: Activity) {
    }

    override fun onActivityPaused(activity: Activity) {
    }

    override fun onActivityStopped(activity: Activity) {
        if (activity !is MainActivity) {
            DialogInstance.instance.hideDialog()
        }
    }

    override fun onActivitySaveInstanceState(activity: Activity, outState: Bundle) {
    }

    override fun onActivityDestroyed(activity: Activity) {
    }


}